<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>

    // 已注册的帐号信息： 
    let persons = [
                { "username":"xiaoming1","password":"1111" },
                { "username":"xiaoming2","password":"222" },
                { "username":"xiaoming3","password":"33333" },
            ];

    //用户输入的帐号及密码： 
        let user = { username:"admin1",password:"12345" }


        let flag = false; //登录失败
        for(let obj of persons){
             if(user.username == obj.username && user.password == obj.password){
                flag = true;
             }
        }

        if(flag){
            alert('登录成功');
        }else{
            alert('登录失败');
        }

    </script>
</head>
<body>
    
</body>
</html>